package com.zan.controller;

import com.zan.entity.User;
import com.zan.service.LoginService;
import com.zan.vo.ResponseResult;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @Author Zan
 * @Date 2023/10/17 14:32
 * @Description :
 */
@RestController
@CrossOrigin
@RequestMapping("/user")
public class UserLoginController {

    @Resource
    private LoginService loginService;

    @PostMapping("/login")
    public ResponseResult login(@RequestBody User user) {
        return loginService.login(user);
    }

    @GetMapping("/logout")
    public ResponseResult logout() {
        return loginService.logout();
    }

}
